package org.csu.mall.service;

import org.csu.mall.common.UniformResponse;
import org.csu.mall.entity.Product;
import org.csu.mall.vo.ProductVO;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;

public interface IProductService {
    UniformResponse<ProductVO> getProductDetail(Integer productId);//获取商品信息
    UniformResponse<List<Product>> searchByText(String info);//通过搜索栏进行搜索
    UniformResponse<List<Product>> searchByLabel(String label);//通过标签进行搜索
    UniformResponse productList(Integer categoryId,String keyword,int pageNum,int pageSize,String orderBy);//商品列表排序分页
    UniformResponse recommendProduct(String keyword,Integer pageNum,Integer pageSize);//相似商品推荐
    //后端管理商品
    UniformResponse getProducts(int pageNum,int pageSize);//后端查看商城商品
    UniformResponse<Product> addProduct(Integer categoryId,
                                              String subTitle,
                                             String mainImage,
                                             String subImages,
                                            String detail,
                                              BigDecimal price,
                                              Integer stock,
                                              Integer status,
                                              String name
                                        ) throws IOException;//添加商品
    UniformResponse<String> deleteProduct(Integer productId);//删除商品
    UniformResponse<Product> updateProduct( Integer productId,
                                           Integer categoryId,
                                          String subTitle,
                                          String mainImage,
                                           String subImages,
                                           String detail,
                                           BigDecimal price,
                                          Integer stock,
                                          Integer status,
                                           String name
    );//更新商品
//    UniformResponse upload(MultipartFile file);//上传文件


}
